home *** CD-ROM | disk | FTP | other *** search
/ Clickx 75 / Clickx 75.iso / software / expressionweb / expressionwebv3 / ExpressionWeb_en.exe / Setup / WeComn.cab / xWeb.fpeditax.dll / HTML / 41 next >
Encoding:
Extensible Markup Language  |  2009-07-15  |  62.9 KB  |  1,707 lines

  1. <xsl:stylesheet 
  2.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  3.     xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
  4.     xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
  5.     xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
  6.     xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
  7.     xmlns:out="urn:sample"
  8.     xmlns:outscr="urn:twiddle"
  9.     xmlns:SharePoint="Microsoft.SharePoint.WebControls"
  10.     exclude-result-prefixes="xsl msxsl"
  11.     version="1.0">
  12. <xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes" />
  13. <xsl:preserve-space elements="*"/>
  14. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  15. <xsl:namespace-alias stylesheet-prefix="outscr" result-prefix="msxsl"/>
  16.  
  17. <!-- params designed to be overridden by the caller -->
  18. <xsl:param name="ID">1</xsl:param>
  19. <xsl:param name="TopLevel">1</xsl:param>
  20. <xsl:param name="FrameworkOnly">0</xsl:param>
  21. <xsl:param name="ViewSpec">
  22.     <View>
  23.         <RowPath>/catalog/book</RowPath>
  24.         <Fields>
  25.             <Field FName="fld_1" FormFieldPrefix="ff_2" Value="title" ValueRaw="title" KeyName="keyname" KeyXPath="keyxpath" Title="title" ReadOnly="1" Type="text" Required="1"/>
  26.             <Field FName="fld_2" FormFieldPrefix="ff_3" Value="author" ValueRaw="title" KeyName="keyname" KeyXPath="keyxpath" Title="author" ReadOnly="0" Type="text"/>
  27.             <Field FName="fld_3" FormFieldPrefix="ff_4" Value="genre" ValueRaw="title" KeyName="keyname" KeyXPath="keyxpath" Title="genre" ReadOnly="1" Type="text"/>
  28.         </Fields>
  29.     </View>
  30. </xsl:param>
  31. <xsl:param name="StyleName">Table</xsl:param>
  32. <xsl:param name="ShowToolbar">0</xsl:param>
  33. <xsl:param name="DoXSLPaging">1</xsl:param>
  34. <xsl:param name="UsePaging">0</xsl:param>
  35. <xsl:param name="RowLimit">100</xsl:param>
  36. <xsl:param name="ShowHeader">0</xsl:param>
  37. <xsl:param name="ShowFooter">0</xsl:param>
  38. <xsl:param name="DoXSLJoin">0</xsl:param>
  39. <xsl:param name="GenerateForm">0</xsl:param>
  40. <xsl:param name="ShowFormToolbar">0</xsl:param>
  41. <xsl:param name="FormControlMode"></xsl:param>
  42. <xsl:param name="HasID">0</xsl:param>
  43. <xsl:param name="ShowTitle">0</xsl:param>
  44. <xsl:param name="DocLib">0</xsl:param>
  45.  
  46. <!-- all localized text params -->
  47. <xsl:param name="dvt_ViewEmptyText">There are no items to display in this view.</xsl:param>
  48. <xsl:param name="ChooseText">Choose one...</xsl:param>
  49. <xsl:param name="PreviousLinkText">Previous</xsl:param>
  50. <xsl:param name="NextLinkText">Next</xsl:param>
  51. <xsl:param name="FirstLinkText">Start</xsl:param>
  52. <xsl:param name="PageItemText">Item</xsl:param>
  53. <xsl:param name="PageItemsText">Items</xsl:param>
  54. <xsl:param name="ViewText">View:</xsl:param>
  55. <xsl:param name="CountText">Count</xsl:param>
  56. <xsl:param name="AscendingText">Ascending</xsl:param>
  57. <xsl:param name="DescendingText">Descending</xsl:param>
  58. <xsl:param name="FilterText">Filter</xsl:param>
  59. <xsl:param name="YesText">Yes</xsl:param>
  60. <xsl:param name="NoText">No</xsl:param>
  61. <xsl:param name="EmptyOptionText">(Empty)</xsl:param>
  62. <xsl:param name="AllOptionText">(All)</xsl:param>
  63. <xsl:param name="DefaultLCID">1033</xsl:param>
  64. <xsl:param name="DefaultDateFormat">5</xsl:param>
  65. <xsl:param name="DefaultNumberFormat">#,##0.##;-#,##0.##</xsl:param>
  66. <xsl:param name="SaveButtonText">Save</xsl:param>
  67. <xsl:param name="CancelButtonText">Cancel</xsl:param>
  68. <xsl:param name="SaveLinkText">save</xsl:param>
  69. <xsl:param name="CancelLinkText">cancel</xsl:param>
  70. <xsl:param name="EditLinkText">edit</xsl:param>
  71. <xsl:param name="DeleteLinkText">delete</xsl:param>
  72. <xsl:param name="InsertLinkText">insert</xsl:param>
  73.  
  74. <!-- global variables -->
  75. <xsl:variable name="basename" select="concat('dvt_',$ID)" />
  76. <xsl:variable name="View" select="msxsl:node-set($ViewSpec)/View" />
  77. <xsl:variable name="Style" select="/ViewStyles/Style[ID=$StyleName]" />
  78. <xsl:variable name="Defaults" select="/ViewStyles/Defaults" />
  79.  
  80. <xsl:template match="/">
  81.   <xsl:choose>
  82.     <xsl:when test="$FrameworkOnly = '1'">
  83.       <out:stylesheet version="1.0" 
  84.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  85.                 xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
  86.                 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  87.                 xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
  88.                 xmlns:SharePoint="Microsoft.SharePoint.WebControls"
  89.                 xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
  90.                 exclude-result-prefixes="xsl msxsl ddwrt">
  91.  
  92.         <out:output method="html" indent="no"/>
  93.         <out:decimal-format NaN=""/>
  94.  
  95.         <xsl:call-template name="gen-dvt-framework" />
  96.  
  97.       </out:stylesheet>
  98.     </xsl:when>
  99.     <xsl:when test="$TopLevel = '1'">
  100.       <out:stylesheet version="1.0" 
  101.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  102.                 xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
  103.                 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  104.                 xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
  105.                 xmlns:SharePoint="Microsoft.SharePoint.WebControls"
  106.                 xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
  107.                 exclude-result-prefixes="xsl msxsl ddwrt">
  108.  
  109.         <out:output method="html" indent="no"/>
  110.         <out:decimal-format NaN=""/>
  111.         
  112.         <xsl:call-template name="gen-dvt-framework" />
  113.  
  114.         <out:template match="/">
  115.           <out:call-template name="{$basename}"/>
  116.         </out:template>
  117.  
  118.         <xsl:apply-templates select="$Style" />
  119.       </out:stylesheet>
  120.     </xsl:when>
  121.     <xsl:otherwise>
  122.       <xsl:apply-templates select="$Style" />
  123.     </xsl:otherwise>
  124.   </xsl:choose>
  125. </xsl:template>
  126.  
  127. <xsl:template name="gen-dvt-framework">
  128.  
  129. <!-- BEGIN: params set by runtime -->
  130.  
  131. <out:param name="dvt_apos">'</out:param>
  132.  
  133. <!-- END: params set by runtime -->
  134.  
  135. <!-- automode variable, managed by DVT manager -->
  136. <out:variable name="{$basename}_automode">0</out:variable>
  137.  
  138.  
  139. <!-- generic template to display a header field -->
  140. <out:template name="dvt.headerfield">
  141. <out:param name="fieldname"/>
  142. <out:param name="fieldtitle"/>
  143. <out:param name="displayname"/>
  144. <out:param name="sortable">1</out:param>
  145. <out:param name="fieldtype">0</out:param>
  146. <out:choose>
  147. <out:when test="($dvt_adhocmode = 'sort' or $dvt_fieldsort = '1')and $sortable='1'">
  148. <out:variable name="sortfield">
  149.     <out:choose>
  150.         <out:when test="substring($fieldname, string-length($fieldname) - 5) = '(text)'">
  151.             <out:value-of select="substring($fieldname, 1, string-length($fieldname) - 6)"/>
  152.         </out:when>
  153.         <out:when test="substring($fieldname, 1, 1) = '@'">
  154.             <out:value-of select="substring($fieldname, 2)"/>
  155.         </out:when>
  156.         <out:otherwise>
  157.             <out:value-of select="$fieldname"/>
  158.         </out:otherwise>
  159.     </out:choose>
  160. </out:variable>
  161. <out:variable name="linkdir">
  162.     <out:choose>
  163.         <out:when test="$dvt_sortfield = $sortfield and $dvt_sortdir = 'ascending'">descending</out:when>
  164.         <out:otherwise>ascending</out:otherwise>
  165.     </out:choose>
  166. </out:variable>
  167. <out:variable name="sortText">
  168.     <out:choose>
  169.         <out:when test="$linkdir='descending'">' + 'descending' + '</out:when>
  170.         <out:otherwise>' + 'ascending' + '</out:otherwise>
  171.     </out:choose>
  172. </out:variable>
  173.  
  174. <out:variable name="separator" select="' '"/>
  175. <out:variable name="connector" select="';'"/>
  176. <table CtxNum="1" cellspacing="0" class="ms-unselectedtitle">
  177.     <xsl:attribute name="onmouseover">OnMouseOverAdHocFilter(this, '{concat($displayname,$separator,$fieldname, $separator,$fieldtype, $connector, <xsl:value-of select="$DefaultLCID"/>, $separator, $dvt_partguid)}')</xsl:attribute>
  178. <tr><td width="100%" class="ms-vb" nowrap="nowrap">
  179. <a>
  180.     <out:attribute name="href">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_sortfield={{',$sortfield,'}};dvt_sortdir={{',$sortText,'}}'))" />;</out:attribute>
  181.     <out:attribute name="onclick">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_sortfield={{',$sortfield,'}};dvt_sortdir={{',$sortText,'}}'))" />;</out:attribute>
  182.     <out:choose>
  183.         <out:when test="$fieldtype = 'Attachments'">
  184.             <out:value-of select="$fieldtitle" disable-output-escaping="yes"/>
  185.         </out:when>        
  186.         <out:otherwise>
  187.             <out:value-of select="$fieldtitle"/>
  188.         </out:otherwise>
  189.     </out:choose>
  190.     <out:if test="$dvt_sortfield = $sortfield">
  191.     <out:choose>
  192.         <out:when test="$dvt_sortdir = 'ascending'">
  193.             <img border="0" alt="{$AscendingText}" src="{{ddwrt:FieldSortImageUrl('Desc')}}" />
  194.         </out:when>
  195.         <out:when test="$dvt_sortdir = 'descending'">
  196.             <img border="0" alt="{$DescendingText}" src="{{ddwrt:FieldSortImageUrl('Asc')}}" />
  197.         </out:when>
  198.     </out:choose>
  199.     </out:if>
  200. </a>
  201. <out:if test="contains($dvt_filterfields, concat($fieldname, ';' ))">
  202.     <IMG SRC="/_layouts/images/filter.gif" BORDER="0" ALT=""/>
  203. </out:if>
  204. </td>
  205. <td><img src="/_layouts/images/blank.gif" width="13" style="visibility: hidden" alt=""/></td>
  206. </tr>
  207. </table>
  208. </out:when>
  209. <out:otherwise>
  210.     <out:choose>
  211.         <out:when test="$fieldtype = 'Attachments'">
  212.             <out:value-of select="$fieldtitle" disable-output-escaping="yes"/>
  213.         </out:when>        
  214.         <out:otherwise>
  215.             <out:value-of select="$fieldtitle"/>
  216.         </out:otherwise>
  217.     </out:choose>
  218. </out:otherwise>
  219. </out:choose>
  220. <out:if test="$dvt_filterfield=$fieldname" ddwrt:cf_ignore="1"><img alt="{$FilterText}" src="{{ddwrt:FieldFilterImageUrl('')}}"/></out:if>
  221. </out:template>
  222.  
  223. <!-- generic template to display a filter field -->
  224. <out:template name="dvt.filterfield">
  225. <out:param name="fieldname"/>
  226. <out:param name="fieldtitle"/>
  227. <out:param name="Rows" />
  228. <out:param name="fieldtype" />
  229. <out:variable name="dvt_FieldNameNoAtSign" select="substring-after($fieldname, '@')"/>
  230. <out:variable name="filtertype"><out:if test="starts-with($fieldtype,'date')">date</out:if></out:variable>
  231. <out:variable name="sorttype"><out:choose><out:when test="starts-with($fieldtype,'number')">number</out:when><out:otherwise>text</out:otherwise></out:choose></out:variable>
  232. <out:variable name="clientText">' + this.options[this.selectedIndex].value + '</out:variable>
  233. <out:if test="not(contains($fieldname, '/')) and not(contains($fieldname, '['))" ddwrt:cf_ignore="1">
  234. <out:value-of select="$fieldtitle"/>
  235. <out:text disable-output-escaping="yes">:<br></out:text>
  236. <select name="{{$fieldname}}_filterval">
  237.     <out:attribute name="onchange">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('NotUTF8;dvt_filterfield={{',$fieldname,'}};dvt_filtertype={{',$filtertype,'}};dvt_adhocmode={{false()}};dvt_filterval={{',$clientText,'}}'))" />;</out:attribute>
  238. <option value="##dvt_empty##">
  239.     <out:if test="$dvt_filterfield=$fieldname and $dvt_filterval=''">
  240.         <out:attribute name="selected">true</out:attribute>
  241.     </out:if>
  242.     <xsl:value-of select="$EmptyOptionText"/>
  243. </option>
  244. <option value="##dvt_all##">
  245.     <out:choose>
  246.         <out:when test="not($dvt_filterfield)">
  247.             <out:attribute name="selected">true</out:attribute>
  248.         </out:when>
  249.         <out:when test="$dvt_filterfield!=$fieldname">
  250.             <out:attribute name="selected">true</out:attribute>
  251.         </out:when>
  252.     </out:choose>
  253.     <xsl:value-of select="$AllOptionText"/>
  254. </option>
  255. <out:value-of select="ddwrt:NameChanged('',1)"/>
  256. <out:choose>
  257.     <out:when test="starts-with($fieldname, '@')">
  258.         <out:variable name="dvt_Rows">
  259.             <out:for-each select="$Rows">
  260.                 <out:sort select="@*[name()=$fieldname]" order="ascending" data-type="{{$sorttype}}"/>
  261.                 <out:copy-of select="." />
  262.             </out:for-each>
  263.         </out:variable>
  264.         <out:for-each select="msxsl:node-set($dvt_Rows)/*[not(@*[name()=$dvt_FieldNameNoAtSign]=preceding-sibling::*[1]/@*[name()=$dvt_FieldNameNoAtSign])]/@*[name()=$dvt_FieldNameNoAtSign]">
  265.             <out:sort data-type="{{$sorttype}}" />
  266.             <out:call-template name="dvt.filteroption">
  267.                 <out:with-param name="name" select="$fieldname"/>
  268.                 <out:with-param name="value" select="."/>
  269.                 <out:with-param name="type" select="$fieldtype"/>
  270.             </out:call-template>
  271.         </out:for-each>
  272.     </out:when>
  273.     <out:when test="$fieldname = '.'">
  274.         <out:variable name="dvt_Rows">
  275.             <out:for-each select="$Rows">
  276.                 <out:sort select="." order="ascending" data-type="{{$sorttype}}"/>
  277.                 <out:copy-of select="." />
  278.             </out:for-each>
  279.         </out:variable>
  280.         <out:for-each select="msxsl:node-set($dvt_Rows)/*[not(.=preceding-sibling::*[1])]">
  281.             <out:sort data-type="{{$sorttype}}" />
  282.             <out:call-template name="dvt.filteroption">
  283.                 <out:with-param name="name" select="$fieldname"/>
  284.                 <out:with-param name="value" select="."/>
  285.                 <out:with-param name="type" select="$fieldtype"/>
  286.             </out:call-template>
  287.         </out:for-each>
  288.     </out:when>
  289.     <out:otherwise>
  290.         <out:variable name="dvt_Rows">
  291.             <out:for-each select="$Rows">
  292.                 <out:sort select="*[name()=$fieldname]" order="ascending" data-type="{{$sorttype}}"/>
  293.                 <out:copy-of select="." />
  294.             </out:for-each>
  295.         </out:variable>
  296.         <out:for-each select="msxsl:node-set($dvt_Rows)/*[not(*[name()=$fieldname]=preceding-sibling::*[1]/*[name()=$fieldname])]/*[name()=$fieldname]">
  297.             <out:sort data-type="{{$sorttype}}" />
  298.             <out:call-template name="dvt.filteroption">
  299.                 <out:with-param name="name" select="$fieldname"/>
  300.                 <out:with-param name="value" select="."/>
  301.                 <out:with-param name="type" select="$fieldtype"/>
  302.             </out:call-template>
  303.         </out:for-each>
  304.     </out:otherwise>
  305. </out:choose>
  306. <out:value-of select="ddwrt:NameChanged('',1)"/>
  307. </select>
  308. </out:if>
  309. </out:template>
  310.  
  311. <!-- generic template to display a filter field option tag -->
  312. <out:template name="dvt.filteroption">
  313. <out:param name="name"/>
  314. <out:param name="value"/>
  315. <out:param name="type"/>
  316. <out:if test="not(starts-with($type,'date')) or ddwrt:NameChanged($value,1)">
  317. <out:variable name="output">
  318.   <out:choose>
  319.     <out:when test="$type = 'number'">
  320.       <out:value-of select="format-number($value,'{$DefaultNumberFormat}')"/>
  321.     </out:when>
  322.     <out:when test="starts-with($type,'number|')">
  323.       <out:variable name="spec" select="substring-after($type,'|')" />
  324.       <out:choose>
  325.         <out:when test="contains($spec, 'lcid')">
  326.             <out:variable name="apos">'</out:variable>
  327.             <out:variable name="realspec" select="substring-after($spec, $apos)"/>
  328.             <out:variable name="formatspec" select="substring-before($realspec, $apos)"/>
  329.             <out:variable name="formatspec2" select="substring-after($realspec, $apos)"/>
  330.             <out:variable name="lcid" select="normalize-space(substring-after($formatspec2, ','))"/>
  331.             <out:value-of select="format-number($value,string($formatspec), substring($lcid,2,string-length($lcid)-2))"/>
  332.         </out:when>
  333.         <out:otherwise>
  334.             <out:value-of select="format-number($value,substring($spec,2,string-length($spec)-2))"/>        
  335.         </out:otherwise>
  336.       </out:choose>
  337.     </out:when>
  338.     <out:when test="starts-with($type,'date')">
  339.       <!-- don't show time portion when formatting; use long date-only format -->
  340.       <out:value-of select="ddwrt:FormatDate(string($value),{$DefaultLCID},3)"/>
  341.     </out:when>
  342.     <out:otherwise>
  343.       <out:value-of select="$value"/>
  344.     </out:otherwise>
  345.   </out:choose>
  346. </out:variable>
  347. <option>
  348.   <out:attribute name="value">
  349.     <out:value-of select="ddwrt:ConnEncode(normalize-space($value))" />
  350.   </out:attribute>
  351.   <out:if test="$dvt_filterfield=$name and $dvt_filterval=normalize-space($value) and $dvt_filterval!=''">
  352.     <out:attribute name="selected">true</out:attribute>
  353.   </out:if>
  354.   <out:choose>
  355.     <out:when test="string-length($output) > 40">
  356.       <out:value-of select="substring($output, 1, 40)"/> ...
  357.     </out:when>
  358.     <out:otherwise>
  359.       <out:value-of select="$output"/>
  360.     </out:otherwise>
  361.   </out:choose>
  362. </option>
  363. </out:if>
  364. </out:template>
  365.  
  366. </xsl:template>
  367.  
  368. <xsl:template match="Style">
  369.  
  370.   <!-- output all the templates -->
  371.  
  372.   <xsl:apply-templates select="Main"/>
  373.   <xsl:call-template name="GenHeader"/>
  374.   <xsl:apply-templates select="Body"/>
  375.   <xsl:call-template name="GenFooter"/>
  376.   <xsl:call-template name="GenSummary"/>
  377.   <xsl:call-template name="GenEmpty"/>
  378.   <xsl:apply-templates select="GroupHeader"/>
  379.   <xsl:apply-templates select="GroupFooter"/>
  380.   <xsl:apply-templates select="AutoMode"/>
  381.  
  382.   <!-- TODO: shouldn't generate these in a TopLevel template -->
  383.   <xsl:if test="not($FormControlMode and $ShowTitle='1')">
  384.     <xsl:call-template name="GenToolbar"/>
  385.     <xsl:call-template name="GenLVToolbar"/>
  386.     <xsl:call-template name="GenCommandFooter"/>
  387.     <xsl:call-template name="GenNavigation"/>
  388.  
  389.     <!-- form stuff -->
  390.     <xsl:call-template name="GenFormActions"/>
  391.   </xsl:if>
  392.  
  393.   <xsl:if test="not($FormControlMode and $ShowTitle='1') or $FormControlMode='New'">
  394.     <xsl:call-template name="GenRowInsert"/>
  395.   </xsl:if>
  396.  
  397. </xsl:template>
  398.  
  399. <xsl:template name="gen-field-view">
  400.     <xsl:param name="xpath" />
  401.     <xsl:param name="title" />
  402.     <xsl:param name="type" />
  403.     <xsl:param name="rich" />
  404.  
  405.     <xsl:choose>
  406.  
  407.         <!-- field Type="Note", a.k.a. rich text -->
  408.         <xsl:when test="$type='Note'"> 
  409.             <xsl:choose>
  410.                 <xsl:when test="$rich='0'">
  411.                     <out:value-of select="{$xpath}" />
  412.                 </xsl:when>
  413.                 <xsl:otherwise>
  414.                     <out:value-of select="{$xpath}" disable-output-escaping="yes"/>
  415.                 </xsl:otherwise>
  416.             </xsl:choose>
  417.         </xsl:when>
  418.  
  419.         <!-- field Type="Boolean", a.k.a. yes/no -->
  420.         <xsl:when test="$type='Boolean'">
  421.             <out:choose>
  422.                 <out:when test="{$xpath}='1' or msxsl:string-compare(string({$xpath}),'{$YesText}','','i')=0 or msxsl:string-compare(string({$xpath}),'True','','i')=0">
  423.                     <xsl:value-of select="$YesText"/>
  424.                 </out:when>
  425.                 <out:otherwise>
  426.                     <xsl:value-of select="$NoText"/>
  427.                 </out:otherwise>
  428.             </out:choose>
  429.         </xsl:when>
  430.  
  431.         <!-- field Type="URL", Format="Hyperlink" -->
  432.         <xsl:when test="$type='Hyperlink'">
  433.             <a>
  434.                 <xsl:attribute name="href">{substring-before(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute>
  435.                 <out:value-of select="substring-after({$xpath}, ', ')"/>
  436.             </a>
  437.         </xsl:when>
  438.  
  439.         <!-- field Type="URL", Format="Image" -->
  440.         <xsl:when test="$type='Image'">
  441.             <img border="0">
  442.                 <xsl:attribute name="src">{substring-before(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute>
  443.                 <xsl:attribute name="alt">{substring-after(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute>
  444.             </img>
  445.         </xsl:when>
  446.  
  447.         <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" -->
  448.         <xsl:when test="$type='DocHyperlink'">
  449.             <a>
  450.                 <xsl:attribute name="href">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  451.                 <out:value-of select="{$xpath}"/>
  452.             </a>
  453.         </xsl:when>
  454.  
  455.         <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" -->
  456.         <xsl:when test="$type='DocImage'">
  457.             <img border="0">
  458.                 <xsl:attribute name="src">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  459.                 <xsl:attribute name="alt">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  460.             </img>
  461.         </xsl:when>
  462.  
  463.         <!-- this indicates the field is actually a subview -->
  464.         <xsl:when test="$type='view'">
  465.             <out:call-template name="{$xpath}"/>
  466.         </xsl:when>
  467.  
  468.         <!-- view regen: expanded types for "number" -->
  469.         <xsl:when test="substring-before($type,'|')='number'">
  470.             <out:value-of select="format-number({$xpath},{substring-after($type,'|')})"/>
  471.         </xsl:when>
  472.  
  473.         <!-- view regen: default for "number" type -->
  474.         <xsl:when test="$type='number'">
  475.             <out:value-of select="format-number({$xpath},'{$DefaultNumberFormat}')"/>
  476.         </xsl:when>
  477.  
  478.         <!-- view regen: expanded types for "date" -->
  479.         <xsl:when test="substring-before($type,'|')='date'">
  480.             <out:value-of select="ddwrt:FormatDate(string({$xpath}),{substring-after($type,'|')})"/>
  481.         </xsl:when>
  482.  
  483.         <!-- view regen: expanded types for "date" -->
  484.         <xsl:when test="substring-before($type,'|')='datetime'">
  485.             <out:value-of select="ddwrt:FormatDateTime(string({$xpath}),{substring-after($type,'|')})"/>
  486.         </xsl:when>
  487.  
  488.         <!-- view regen: default for "date" type -->
  489.         <xsl:when test="$type='date' or $type='datetime'">
  490.             <out:value-of select="ddwrt:FormatDate({$xpath},{$DefaultLCID},{$DefaultDateFormat})"/>
  491.         </xsl:when>
  492.  
  493.         <!-- the default: just use a plain old xsl:value-of tag -->
  494.         <xsl:otherwise>
  495.             <out:value-of select="{$xpath}"/>
  496.         </xsl:otherwise>
  497.  
  498.     </xsl:choose>
  499.     
  500. </xsl:template>
  501.  
  502. <xsl:template name="gen-field-form">
  503.     <xsl:param name="xpath"/>
  504.     <xsl:param name="xpathraw"/>
  505.     <xsl:param name="title"/>
  506.     <xsl:param name="type"/>
  507.     <xsl:param name="keyname"/>
  508.     <xsl:param name="keyxpath"/>
  509.     <xsl:param name="formfieldprefix"/>
  510.   <xsl:param name="choices"/>
  511.   <xsl:param name="outputformat" />
  512.   <xsl:param name="IsInsertField"/>
  513.     
  514.     <xsl:variable name="OpString">
  515.         <xsl:choose>
  516.             <xsl:when test="$IsInsertField = '1'">i</xsl:when>
  517.             <xsl:otherwise>u</xsl:otherwise>
  518.         </xsl:choose>
  519.     </xsl:variable>
  520.  
  521.   <!-- generate special xpath if we're doing insert binding for hierarchical data -->
  522.   <xsl:variable name="LocalKeyXPath">
  523.     <xsl:choose>
  524.       <xsl:when test="$IsInsertField = '1' and $keyxpath = 'string($XPath)'">
  525.         <!--
  526.           // generate the correct xpath value for insertion
  527.           CWString wzRowPath;
  528.           GetRowPath(pwzDVT, wzRowPath, TRUE);
  529.  
  530.           CWString wzInsertKey;
  531.           if (!wzRowPath.IsEmpty() && wzRowPath[0] == L'/')
  532.           {
  533.             wzInsertKey.Format(L"'%s[new]'", wzRowPath);
  534.           }
  535.           else
  536.           {
  537.             wzInsertKey.Format(L"concat(%s,'/%s[new]')", DVT_XPATH_PARAM_AS_STRING, wzRowPath);
  538.           }
  539.         -->
  540.         <xsl:choose>
  541.           <xsl:when test="starts-with($View/RowPath, '/')">'<xsl:value-of select="$View/RowPath"/>[new]'</xsl:when>
  542.           <xsl:otherwise>concat(<xsl:value-of select="$keyxpath"/>,'/<xsl:value-of select="$View/RowPath"/>[new]')</xsl:otherwise>
  543.         </xsl:choose>
  544.       </xsl:when>
  545.       <xsl:otherwise><xsl:value-of select="$keyxpath"/></xsl:otherwise>
  546.     </xsl:choose>
  547.   </xsl:variable>
  548.  
  549.     <xsl:choose>
  550.         <xsl:when test="$FormControlMode">
  551.       <xsl:variable name="FormOp">
  552.                 <xsl:choose>
  553.                     <xsl:when test="$FormControlMode='New' or $OpString = 'i'">i</xsl:when>
  554.                     <xsl:otherwise>u</xsl:otherwise>
  555.                 </xsl:choose>
  556.             </xsl:variable>
  557.       <xsl:variable name="ControlMode">
  558.         <xsl:choose>
  559.           <xsl:when test="$FormOp = 'i'">New</xsl:when>
  560.           <xsl:otherwise><xsl:value-of select="$FormControlMode"/></xsl:otherwise>
  561.         </xsl:choose>
  562.       </xsl:variable>
  563.             <SharePoint:FormField runat="server" id="{$formfieldprefix}{{$Pos}}" ControlMode="{$ControlMode}" FieldName="{substring-after($xpathraw, '@')}">
  564.                 <xsl:if test="not($FormOp = 'i') and $HasID = '1'">
  565.                     <xsl:attribute name="ItemId">{@ID}</xsl:attribute>
  566.                 </xsl:if>
  567.                 <xsl:if test="not($ControlMode = 'Display')">
  568.                     <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$FormOp"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Value','ValueChanged','ID',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute>
  569.                 </xsl:if>        
  570.             </SharePoint:FormField>
  571.       <xsl:if test="$ControlMode = 'New' or $ControlMode = 'Edit'">
  572.         <SharePoint:FieldDescription runat="server" id="{$formfieldprefix}description{{$Pos}}" FieldName="{substring-after($xpathraw, '@')}" ControlMode="{$FormControlMode}"/>
  573.       </xsl:if>
  574.         </xsl:when>
  575.  
  576.     <!-- fields that come enumerated with choices in their schema -->
  577.     <xsl:when test="$choices">
  578.       <xsl:choose>
  579.         <xsl:when test="$outputformat = 'RadioButtons'">
  580.           <SharePoint:DVRadioButtonList runat="server" id="{$formfieldprefix}{{$Pos}}">
  581.             <xsl:if test="not($IsInsertField = '1')">
  582.               <xsl:attribute name="SelectedValue">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  583.             </xsl:if>
  584.             <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'SelectedValue','SelectedIndexChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute>
  585.             <xsl:for-each select="$choices/Choice">
  586.               <asp:ListItem><xsl:value-of select="@Value"/></asp:ListItem>
  587.             </xsl:for-each>
  588.           </SharePoint:DVRadioButtonList>
  589.         </xsl:when>
  590.         <xsl:otherwise>
  591.           <SharePoint:DVDropDownList runat="server" id="{$formfieldprefix}{{$Pos}}">
  592.             <xsl:if test="not($IsInsertField = '1')">
  593.               <xsl:attribute name="SelectedValue">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  594.             </xsl:if>
  595.             <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'SelectedValue','SelectedIndexChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute>
  596.             <xsl:for-each select="$choices/Choice">
  597.               <asp:ListItem><xsl:value-of select="@Value"/></asp:ListItem>
  598.             </xsl:for-each>
  599.           </SharePoint:DVDropDownList>
  600.         </xsl:otherwise>
  601.       </xsl:choose>
  602.     </xsl:when>
  603.     
  604.         <!-- field Type="Note", a.k.a. rich text -->
  605.         <xsl:when test="$type='Note'">
  606.             <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}" TextMode="MultiLine"><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:textbox>
  607.         </xsl:when>
  608.  
  609.         <!-- field Type="Boolean", a.k.a. yes/no -->
  610.         <xsl:when test="$type='Boolean'">
  611.             <xsl:if test="not($IsInsertField = '1')">
  612.                 <out:variable name="{$formfieldprefix}Checked">
  613.                     <out:choose>
  614.                         <out:when test="{$xpath}='1' or msxsl:string-compare(string({$xpath}),'{$YesText}','','i')=0 or msxsl:string-compare(string({$xpath}),'True','','i')=0">true</out:when>
  615.                         <out:otherwise>false</out:otherwise>
  616.                     </out:choose>
  617.                 </out:variable>
  618.             </xsl:if>
  619.             <asp:checkbox runat="server" id="{$formfieldprefix}{{$Pos}}" text=" "><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="checked">{$<xsl:value-of select="$formfieldprefix"/>Checked}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Checked','CheckedChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:checkbox>
  620.         </xsl:when>
  621.  
  622.         <!-- field Type="URL", Format="Hyperlink" -->
  623.         <xsl:when test="$type='Hyperlink'">
  624.             <a>
  625.                 <xsl:attribute name="href">substring-before(<xsl:value-of select="$xpath"/>, ', ')</xsl:attribute>
  626.                 <out:value-of select="substring-after({$xpath}, ', ')"/>
  627.             </a>
  628.         </xsl:when>
  629.  
  630.         <!-- field Type="URL", Format="Image" -->
  631.         <xsl:when test="$type='Image'">
  632.             <img border="0">
  633.                 <xsl:attribute name="src">{substring-before(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute>
  634.                 <xsl:attribute name="alt">{substring-after(<xsl:value-of select="$xpath"/>, ', ')}</xsl:attribute>
  635.             </img>
  636.         </xsl:when>
  637.  
  638.         <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" -->
  639.         <xsl:when test="$type='DocHyperlink'">
  640.             <a href="{{{$xpath}}}">
  641.                 <out:value-of select="{$xpath}"/>
  642.             </a>
  643.         </xsl:when>
  644.  
  645.         <!-- field Type="Lookup", List="Docs", ShowField="FullUrl" -->
  646.         <xsl:when test="$type='DocImage'">
  647.             <img border="0">
  648.                 <xsl:attribute name="src">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  649.                 <xsl:attribute name="alt">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  650.             </img>
  651.         </xsl:when>
  652.  
  653.     <!-- this indicates the field is actually a subview -->
  654.     <xsl:when test="$type='view'">
  655.       <!-- don't call the subview if we're an insert field -->
  656.       <xsl:if test="not($IsInsertField = '1')">
  657.         <out:call-template name="{$xpath}"/>
  658.       </xsl:if>
  659.     </xsl:when>
  660.  
  661.     <!-- view regen: expanded types for "number" -->
  662.         <xsl:when test="substring-before($type,'|')='number'">
  663.             <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}"><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:textbox>
  664.         </xsl:when>
  665.  
  666.         <!-- view regen: default for "number" type -->
  667.         <xsl:when test="$type='number'">
  668.             <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}"><xsl:if test="not($IsInsertField = '1')"><xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute></xsl:if><xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute></asp:textbox>
  669.         </xsl:when>
  670.  
  671.         <!-- view regen: default for "date" type -->
  672.         <xsl:when test="substring-before($type,'|')='date' or substring-before($type,'|')='datetime' or $type='dateTime'">
  673.       <SharePoint:DateTimeControl runat="server" id="{$formfieldprefix}{{$Pos}}">
  674.         <xsl:if test="not($IsInsertField = '1')">
  675.           <xsl:attribute name="SelectedDate">{<xsl:value-of select="$xpathraw"/>}</xsl:attribute>
  676.         </xsl:if>
  677.         <xsl:if test="$outputformat = 'DateOnly'">
  678.           <xsl:attribute name="DateOnly">true</xsl:attribute>
  679.         </xsl:if>
  680.         <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'SelectedDate','DateChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute>
  681.       </SharePoint:DateTimeControl>
  682.         </xsl:when>
  683.  
  684.         <!-- the default: just use an asp:textbox -->
  685.         <xsl:otherwise>
  686.             <asp:textbox runat="server" id="{$formfieldprefix}{{$Pos}}">
  687.                 <xsl:if test="not($IsInsertField = '1')">
  688.                     <xsl:attribute name="text">{<xsl:value-of select="$xpath"/>}</xsl:attribute>
  689.                 </xsl:if>
  690.                 <xsl:if test="$outputformat = 'multiLineText'">
  691.                     <xsl:attribute name="TextMode">MultiLine</xsl:attribute>
  692.                 </xsl:if>
  693.                 <xsl:attribute name="__designer:bind">{ddwrt:DataBind('<xsl:value-of select="$OpString"/>',concat('<xsl:value-of select="$formfieldprefix"/>',$Pos),'Text','TextChanged','<xsl:value-of select="$keyname"/>',<xsl:value-of select="$LocalKeyXPath"/>,'<xsl:value-of select="$xpathraw"/>')}</xsl:attribute>
  694.             </asp:textbox>
  695.         </xsl:otherwise>
  696.  
  697.     </xsl:choose>
  698.     
  699. </xsl:template>
  700.  
  701. <xsl:template name="gen-param">
  702.     <out:param name="{@Name}">
  703.         <xsl:value-of select="@Default"/>
  704.     </out:param>
  705. </xsl:template>
  706.  
  707. <xsl:template match="Main">
  708.     <!-- this is the root template for the DVT -->
  709.     <out:template name="{$basename}">
  710.         <xsl:for-each select="$Style/Params/Param">
  711.             <xsl:call-template name="gen-param" />
  712.         </xsl:for-each>
  713.         <out:variable name="dvt_StyleName"><xsl:value-of select="$StyleName" /></out:variable>
  714.         <xsl:if test="$DoXSLJoin = '1'">
  715.             <out:variable name="dvt_ParentRow">
  716.                 <xsl:attribute name="select">current()</xsl:attribute>
  717.             </out:variable>
  718.         </xsl:if>        
  719.         <out:variable name="Rows" select="{$View/RowPath}" />
  720.  
  721.         <!-- TODO: shouldn't generate these in a TopLevel template -->
  722.         <xsl:if test="$ShowToolbar = '1'">
  723.             <out:call-template name="{$basename}.toolbar">
  724.                 <out:with-param name="Rows" select="$Rows" />
  725.                 
  726.             </out:call-template>
  727.         </xsl:if>
  728.  
  729.         <xsl:apply-templates />
  730.         
  731.     </out:template>
  732. </xsl:template>
  733.  
  734. <xsl:template match="Header">
  735.     <out:template name="{$basename}.header">
  736.         <out:param name="Rows"/>
  737.         <xsl:apply-templates />
  738.     </out:template>
  739. </xsl:template>
  740.  
  741. <xsl:template match="Body">
  742.   <out:template name="{$basename}.body">
  743.     <out:param name="Rows"/>
  744.     <xsl:if test="$DoXSLJoin = '1'">
  745.       <out:param name="dvt_ParentRow"/>
  746.     </xsl:if>
  747.  
  748.     <!-- add in the WSS form toolbar.-->
  749.     <xsl:if test="$FormControlMode and $ShowTitle='1'">
  750.       <tr>
  751.         <td class="ms-toolbar" nowrap="nowrap">
  752.           <table>
  753.             <tr>
  754.               <td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
  755.               <xsl:if test="not($FormControlMode = 'Display')">
  756.                 <td class="ms-toolbar" nowrap="nowrap">
  757.                   <SharePoint:SaveButton runat="server" ControlMode="{$FormControlMode}" id="savebutton1"/>
  758.                 </td>
  759.                 <td class="ms-separator"> </td>
  760.               </xsl:if>
  761.               <td class="ms-toolbar" nowrap="nowrap" align="right">
  762.                 <SharePoint:GoBackButton runat="server" ControlMode="{$FormControlMode}" id="gobackbutton1"/>                
  763.               </td>
  764.             </tr>
  765.           </table>
  766.         </td>
  767.       </tr>
  768.       <xsl:if test="$ShowFormToolbar='1'">
  769.         <tr>
  770.             <td class="ms-toolbar" nowrap="nowrap">
  771.                 <SharePoint:FormToolBar runat="server" ControlMode="{$FormControlMode}"/>
  772.             </td>
  773.         </tr>
  774.        </xsl:if>
  775.     </xsl:if>
  776.  
  777.     <xsl:choose>
  778.       <xsl:when test="$FormControlMode='New'">
  779.         <xsl:choose>
  780.           <xsl:when test="$GenerateForm = '1'">
  781.             <out:call-template name="{$basename}.rowedit"/>
  782.           </xsl:when>
  783.           <xsl:otherwise>
  784.             <out:call-template name="{$basename}.rowview"/>
  785.           </xsl:otherwise>
  786.         </xsl:choose>
  787.       </xsl:when>
  788.       <xsl:otherwise>
  789.         <out:for-each select="$Rows">
  790.  
  791.           <!-- calls to .groupheader template go here -->
  792.  
  793.           <xsl:choose>
  794.             <xsl:when test="$GenerateForm = '1'">
  795.               <out:call-template name="{$basename}.rowedit"/>
  796.             </xsl:when>
  797.             <xsl:otherwise>
  798.               <out:call-template name="{$basename}.rowview"/>
  799.             </xsl:otherwise>
  800.           </xsl:choose>
  801.  
  802.           <!-- calls to .groupfooter template go here -->
  803.  
  804.         </out:for-each>
  805.       </xsl:otherwise>
  806.     </xsl:choose>
  807.  
  808.     <xsl:if test="$FormControlMode and $ShowTitle='1'">
  809.         <tr>
  810.             <td class="ms-toolbar" nowrap="nowrap">
  811.                 <table>
  812.                 <tr>
  813.                     <xsl:if test="not($FormControlMode = 'New')">
  814.                     <td class="ms-descriptiontext" nowrap="nowrap">
  815.                         <SharePoint:CreatedModifiedInfo ControlMode="{$FormControlMode}" runat="server"/>
  816.                     </td>
  817.                     </xsl:if>
  818.                     <td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>                        
  819.                     <xsl:if test="not($FormControlMode = 'Display')">
  820.                         <td class="ms-toolbar" nowrap="nowrap">
  821.                             <SharePoint:SaveButton runat="server" ControlMode="{$FormControlMode}" id="savebutton2"/>
  822.                         </td>
  823.                         <td class="ms-separator"> </td>
  824.                     </xsl:if>            
  825.                     <td class="ms-toolbar" nowrap="nowrap" align="right">
  826.                         <SharePoint:GoBackButton runat="server" ControlMode="{$FormControlMode}" id="gobackbutton2"/>
  827.                     </td>
  828.                 </tr>
  829.                 </table>
  830.             </td>
  831.         </tr>
  832.     </xsl:if>        
  833.   </out:template>
  834.  
  835.   <xsl:apply-templates/>
  836. </xsl:template>
  837.  
  838. <xsl:template match="RowInsert">
  839.   <out:template name="{$basename}.rowinsert">
  840.     <out:param name="IsInsertMode"/>
  841.     <out:variable name="Pos">_new</out:variable>
  842.     <xsl:apply-templates/>
  843.   </out:template>
  844. </xsl:template>
  845.  
  846.   <xsl:template match="Footer">
  847.     <out:template name="{$basename}.footer">
  848.         <out:param name="Rows"/>
  849.         <xsl:apply-templates />
  850.     </out:template>
  851. </xsl:template>
  852.  
  853. <xsl:template match="Summary">
  854.     <out:template name="{$basename}.summary">
  855.         <out:param name="Rows" />
  856.         
  857.         <xsl:apply-templates />
  858.     </out:template>
  859. </xsl:template>
  860.  
  861. <xsl:template match="Empty">
  862.     <out:template name="{$basename}.empty">
  863.         <out:variable name="dvt_ViewEmptyText">
  864.             <xsl:value-of select="$dvt_ViewEmptyText" />
  865.         </out:variable>
  866.         <xsl:apply-templates />
  867.     </out:template>
  868. </xsl:template>
  869.  
  870. <xsl:template match="dvt_groupImage">
  871.     <img src="{{$imagesrc}}" border="0" alt="{{$alttext}}" name="{{$altname}}"/>
  872. </xsl:template>
  873.  
  874. <xsl:template match="Toolbar">
  875.     <out:template name="{$basename}.toolbar">
  876.         <out:param name="Rows" />
  877.  
  878.         <xsl:apply-templates />
  879.     </out:template>
  880. </xsl:template>
  881.  
  882. <xsl:template match="ListViewToolbar">
  883.     <out:template name="{$basename}.listviewtoolbar">
  884.         <out:param name="Rows" />
  885.  
  886.         <xsl:apply-templates />
  887.     </out:template>
  888. </xsl:template>
  889.  
  890. <xsl:template match="RowView">
  891.     <out:template name="{$basename}.rowview">
  892.         <xsl:apply-templates/>
  893.     </out:template>
  894. </xsl:template>
  895.  
  896. <xsl:template match="RowEdit">
  897.     <out:template name="{$basename}.rowedit">
  898.         <xsl:apply-templates/>
  899.     </out:template>
  900. </xsl:template>
  901.  
  902. <xsl:template match="CommandFooter">
  903.     <out:template name="{$basename}.commandfooter">
  904.         <out:param name="FirstRow"/>
  905.         <out:param name="LastRow"/>
  906.         <out:param name="RowLimit"/>
  907.         <out:param name="dvt_RowCount"/>
  908.         <out:param name="RealLastRow"/>
  909.         
  910.         <xsl:apply-templates/>
  911.     </out:template>
  912. </xsl:template>
  913.  
  914. <xsl:template match="FormActions">
  915.     <out:template name="{$basename}.formactions">
  916.         <xsl:apply-templates/>
  917.     </out:template>
  918. </xsl:template>
  919.  
  920. <xsl:template match="AutoMode">
  921.     <out:template name="{$basename}.automode">
  922.         <out:param name="KeyField"/>
  923.         <out:param name="KeyValue"/>
  924.         <out:param name="Mode"/>
  925.         
  926.         <xsl:choose>
  927.             <xsl:when test="text() = 'vertical'">
  928.                 <xsl:apply-templates select="msxsl:node-set($Defaults)/AutoModeVertical/*"/>
  929.             </xsl:when>
  930.             <xsl:otherwise>
  931.                 <xsl:apply-templates select="msxsl:node-set($Defaults)/AutoModeHorizontal/*"/>
  932.             </xsl:otherwise>
  933.         </xsl:choose>
  934.     </out:template>
  935. </xsl:template>
  936.  
  937. <xsl:template match="Navigation">
  938.     <out:template name="{$basename}.navigation">
  939.         <out:param name="FirstRow"/>
  940.         <out:param name="LastRow"/>
  941.         <out:param name="RowLimit"/>
  942.         <out:param name="dvt_RowCount"/>
  943.         <out:param name="RealLastRow"/>
  944.         
  945.         <out:variable name="PrevRow">
  946.             <out:choose>
  947.                 <out:when test="$FirstRow - $RowLimit < 1">1</out:when>
  948.                 <out:otherwise>
  949.                     <out:value-of select="$FirstRow - $RowLimit"/>
  950.                 </out:otherwise>
  951.             </out:choose>
  952.         </out:variable>
  953.         <xsl:apply-templates />
  954.     </out:template>
  955. </xsl:template>
  956.  
  957. <xsl:template match="GroupHeader">
  958.     <out:template name="{$basename}.groupheader">
  959.         <out:param name="fieldtitle"/>
  960.         <out:param name="fieldname"/>
  961.         <out:param name="fieldvalue"/>
  962.         <out:param name="fieldtype"/>
  963.         <out:param name="nodeset"/>
  964.         <out:param name="groupid"/>
  965.         <out:param name="displaystyle"/>
  966.         <out:param name="imagesrc"/>
  967.         <out:param name="alttext"/>
  968.         <out:param name="altname"/>
  969.         <out:param name="hidedetail"/>
  970.         <out:param name="showheader"/>
  971.         <out:param name="showheadercolumn"/>
  972.         <xsl:apply-templates />
  973.     </out:template>
  974. </xsl:template>
  975.  
  976. <xsl:template match="GroupFooter">
  977.     <out:template name="{$basename}.groupfooter">
  978.         <out:param name="fieldtitle"/>
  979.         <out:param name="fieldname"/>
  980.         <out:param name="fieldvalue"/>
  981.         <out:param name="fieldtype"/>
  982.         <out:param name="nodeset"/>
  983.         <out:param name="groupid"/>
  984.         <out:param name="displaystyle"/>
  985.         <out:param name="showfooter"/>
  986.         <out:param name="showfootercolumn"/>
  987.         <xsl:apply-templates />
  988.     </out:template>
  989. </xsl:template>
  990.  
  991. <!-- templates to generate default parts of views -->
  992.  
  993. <xsl:template name="GenEmpty">
  994.     <xsl:choose>
  995.         <xsl:when test="Empty">
  996.             <xsl:apply-templates select="Empty" />
  997.         </xsl:when>
  998.         <xsl:otherwise>
  999.             <xsl:apply-templates select="msxsl:node-set($Defaults)/Empty" />
  1000.         </xsl:otherwise>
  1001.     </xsl:choose>
  1002. </xsl:template>
  1003.  
  1004. <xsl:template name="GenHeader">
  1005.     <xsl:choose>
  1006.         <xsl:when test="Header">
  1007.             <xsl:apply-templates select="Header" />
  1008.         </xsl:when>
  1009.         <xsl:otherwise>
  1010.             <xsl:apply-templates select="msxsl:node-set($Defaults)/Header" />
  1011.         </xsl:otherwise>
  1012.     </xsl:choose>
  1013. </xsl:template>
  1014.  
  1015. <xsl:template name="GenFooter">
  1016.     <xsl:choose>
  1017.         <xsl:when test="Footer">
  1018.             <xsl:apply-templates select="Footer" />
  1019.         </xsl:when>
  1020.         <xsl:otherwise>
  1021.             <xsl:apply-templates select="msxsl:node-set($Defaults)/Footer" />
  1022.         </xsl:otherwise>
  1023.     </xsl:choose>
  1024. </xsl:template>
  1025.  
  1026. <xsl:template name="GenSummary">
  1027.     <xsl:choose>
  1028.         <xsl:when test="Summary">
  1029.             <xsl:apply-templates select="Summary" />
  1030.         </xsl:when>
  1031.         <xsl:otherwise>
  1032.             <xsl:apply-templates select="msxsl:node-set($Defaults)/Summary" />
  1033.         </xsl:otherwise>
  1034.     </xsl:choose>
  1035. </xsl:template>
  1036.  
  1037. <xsl:template name="GenToolbar">
  1038.     <xsl:choose>
  1039.         <xsl:when test="Toolbar">
  1040.             <xsl:apply-templates select="Toolbar" />
  1041.         </xsl:when>
  1042.         <xsl:otherwise>
  1043.             <xsl:apply-templates select="msxsl:node-set($Defaults)/Toolbar" />
  1044.         </xsl:otherwise>
  1045.     </xsl:choose>
  1046. </xsl:template>
  1047.  
  1048. <xsl:template name="GenLVToolbar">
  1049.     <xsl:choose>
  1050.         <xsl:when test="ListViewToolbar">
  1051.             <xsl:apply-templates select="ListViewToolbar" />
  1052.         </xsl:when>
  1053.         <xsl:otherwise>
  1054.             <xsl:apply-templates select="msxsl:node-set($Defaults)/ListViewToolbar" />
  1055.         </xsl:otherwise>
  1056.     </xsl:choose>
  1057. </xsl:template>
  1058.  
  1059. <xsl:template name="GenCommandFooter">
  1060.     <xsl:choose>
  1061.         <xsl:when test="CommandFooter">
  1062.             <xsl:apply-templates select="CommandFooter" />
  1063.         </xsl:when>
  1064.         <xsl:otherwise>
  1065.             <xsl:apply-templates select="msxsl:node-set($Defaults)/CommandFooter" />
  1066.         </xsl:otherwise>
  1067.     </xsl:choose>
  1068. </xsl:template>
  1069.  
  1070. <xsl:template name="GenFormActions">
  1071.  
  1072.     <xsl:choose>
  1073.         <xsl:when test="CommandFooter">
  1074.             <xsl:apply-templates select="FormActions" />
  1075.         </xsl:when>
  1076.         <xsl:otherwise>
  1077.             <xsl:apply-templates select="msxsl:node-set($Defaults)/FormActions" />
  1078.         </xsl:otherwise>
  1079.     </xsl:choose>
  1080. </xsl:template>
  1081.  
  1082. <xsl:template name="GenNavigation">
  1083.     <xsl:choose>
  1084.         <xsl:when test="Navigation">
  1085.             <xsl:apply-templates select="Navigation" />
  1086.         </xsl:when>
  1087.         <xsl:otherwise>
  1088.             <xsl:apply-templates select="msxsl:node-set($Defaults)/Navigation" />
  1089.         </xsl:otherwise>
  1090.     </xsl:choose>
  1091. </xsl:template>
  1092.  
  1093. <xsl:template name="GenRowInsert">
  1094.     <xsl:if test="RowInsert">
  1095.         <xsl:apply-templates select="RowInsert"/>
  1096.     </xsl:if>
  1097. </xsl:template>
  1098.  
  1099. <!-- implement the known tags in the "dvt" namespace -->
  1100.  
  1101. <!-- this tag only works in Navigation template -->
  1102. <xsl:template match="dvt_PrevLink">
  1103.     <!-- DSP paging does not support previous; use browser history link instead -->
  1104.     <!-- if we are doing xsl paging, then we can simply pass the firstrow value -->
  1105.     <a>
  1106.         <out:attribute name="href">
  1107.             <xsl:choose>
  1108.                 <xsl:when test="not($DoXSLPaging = '1')">javascript: history.back();</xsl:when>
  1109.                 <xsl:otherwise>javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={{',$PrevRow,'}}'))" />;</xsl:otherwise>
  1110.             </xsl:choose>
  1111.         </out:attribute>
  1112.         <img src="/_layouts/images/prev.gif" border="0" alt="{$PreviousLinkText}"/>
  1113.     </a>
  1114. </xsl:template>
  1115.  
  1116. <!-- this tag only works in Navigation template -->
  1117. <xsl:template match="dvt_NextLink">
  1118.     <!-- if we are doing DSP paging, then we have to pass the dvt_nextpagedata back as the dvt_startposition -->
  1119.     <!-- if we are doing xsl paging, then we can simply pass the firstrow value -->
  1120.     <out:if test="$LastRowValue < $dvt_RowCount or string-length($dvt_nextpagedata)!=0" ddwrt:cf_ignore="1">
  1121.         <a>
  1122.             <out:attribute name="href">
  1123.                 <xsl:choose>
  1124.                     <xsl:when test="not($DoXSLPaging = '1')">javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={{',$NextRow,'}};dvt_startposition={{',$dvt_nextpagedata,'}}'))" />;</xsl:when>
  1125.                     <xsl:otherwise>javascript: <out:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={{',$NextRow,'}}'))" />;</xsl:otherwise>
  1126.                 </xsl:choose>
  1127.             </out:attribute>
  1128.             <img src="/_layouts/images/next.gif" border="0" alt="{$NextLinkText}"/>
  1129.         </a>
  1130.     </out:if>
  1131. </xsl:template>
  1132.  
  1133. <!-- this tag only works in Navigation template -->
  1134. <xsl:template match="dvt_FirstLink">
  1135.     <a>
  1136.         <out:attribute name="href">
  1137.         <xsl:choose>
  1138.             <!-- if we are doing DSP paging, then we have to pass the firstrow and the dvt_startposition -->
  1139.             <xsl:when test="not($DoXSLPaging = '1')">javascript: <out:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={{1}};dvt_startposition={{}}')" />;</xsl:when>
  1140.             <!-- if we are doing xsl paging, then we can simply pass the firstrow value -->
  1141.             <xsl:otherwise>javascript: <out:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={{1}}')" />;</xsl:otherwise>
  1142.         </xsl:choose>
  1143.         </out:attribute>
  1144.         <xsl:value-of select="$FirstLinkText"/>
  1145.     </a>
  1146. </xsl:template>
  1147.  
  1148. <!-- this tag only works in Navigation template -->
  1149. <xsl:template match="dvt_IfNotFirstPage">
  1150.     <out:if test="$dvt_firstrow > 1" ddwrt:cf_ignore="1">
  1151.         <xsl:apply-templates/>
  1152.     </out:if>
  1153. </xsl:template>
  1154.  
  1155. <!-- this tag belongs in the FormActions template -->
  1156. <xsl:template match="dvt_SaveButton">
  1157.     <input type="button" value="{$SaveButtonText}" name="btnSave" onclick="javascript: {{ddwrt:GenFireServerEvent('__commit')}}"/>
  1158. </xsl:template>
  1159.  
  1160. <!-- this tag belongs in the FormActions template -->
  1161. <xsl:template match="dvt_CancelButton">
  1162.     <input type="button" value="{$CancelButtonText}" name="btnCancel" onclick="javascript: {{ddwrt:GenFireServerEvent('__cancel')}}"/>
  1163. </xsl:template>
  1164.  
  1165. <xsl:template match="dvt_InsertLink">
  1166.     <a href="javascript: {{ddwrt:GenFireServerEvent('__cancel;{$basename}_form_insertmode={{1}}')}}"><xsl:value-of select="$InsertLinkText"/></a>
  1167. </xsl:template>
  1168.  
  1169. <xsl:template match="dvt_SaveEditLink">
  1170.     <a href="javascript: {{ddwrt:GenFireServerEvent('__commit')}}"><xsl:value-of select="$SaveLinkText"/></a>
  1171. </xsl:template>
  1172.  
  1173. <xsl:template match="dvt_SaveInsertLink">
  1174.     <a href="javascript: {{ddwrt:GenFireServerEvent('__commit')}}"><xsl:value-of select="$SaveLinkText"/></a>
  1175. </xsl:template>
  1176.  
  1177. <xsl:template match="dvt_CancelEditLink">
  1178.     <a href="javascript: {{ddwrt:GenFireServerEvent('__cancel')}}"><xsl:value-of select="$CancelLinkText"/></a>
  1179. </xsl:template>
  1180.  
  1181. <xsl:template match="dvt_CancelInsertLink">
  1182.     <a href="javascript: {{ddwrt:GenFireServerEvent('__cancel')}}"><xsl:value-of select="$CancelLinkText"/></a>
  1183. </xsl:template>
  1184.  
  1185. <xsl:template match="dvt_EditLink">
  1186.     <a href="javascript: {{ddwrt:GenFireServerEvent(concat('__cancel;{$basename}_form_editkey={{',$KeyValue,'}}'))}}"><xsl:value-of select="$EditLinkText"/></a>
  1187. </xsl:template>
  1188.  
  1189. <xsl:template match="dvt_DeleteLink">
  1190.     <a href="javascript: {{ddwrt:GenFireServerEvent(concat('__cancel;__delete={{',$KeyField,'=',$KeyValue,'}};__commit'))}}"><xsl:value-of select="$DeleteLinkText"/></a>
  1191. </xsl:template>
  1192.  
  1193. <xsl:template match="dvt_Header">
  1194.     <xsl:if test="$ShowHeader = '1'" ddwrt:cf_ignore="1">
  1195.         <out:call-template name="{$basename}.header" >
  1196.             <out:with-param name="Rows" select="$Rows"/>
  1197.         </out:call-template>
  1198.     </xsl:if>
  1199. </xsl:template>
  1200.  
  1201. <xsl:template match="dvt_Body">
  1202.     <out:call-template name="{$basename}.body">
  1203.         <out:with-param name="Rows" select="$Rows"/>
  1204.         <xsl:if test="$DoXSLJoin = '1'">
  1205.             <out:with-param name="dvt_ParentRow" select="$dvt_ParentRow"/>
  1206.         </xsl:if>        
  1207.     </out:call-template>
  1208. </xsl:template>
  1209.  
  1210. <xsl:template match="dvt_UploadMenu">
  1211.     <xsl:if test="$DocLib='1'">
  1212.         <td class="ms-toolbar" nowrap="nowrap">
  1213.             <SharePoint:UploadMenu runat="server"/>
  1214.         </td>
  1215.         <td class="ms-toolbar">|</td>
  1216.     </xsl:if>
  1217. </xsl:template>
  1218.  
  1219. <xsl:template match="dvt_AutoMode">
  1220.     <xsl:variable name="KeyFieldSelect">
  1221.         <xsl:choose>
  1222.             <!-- if there is a field with a KeyName -->
  1223.             <xsl:when test="count($View/Fields/Field[string-length(@KeyName) != 0]) > 0">
  1224.                 <xsl:value-of select="$View/Fields/Field[string-length(@KeyName) != 0]/@KeyName"/>
  1225.             </xsl:when>
  1226.             <xsl:otherwise></xsl:otherwise>
  1227.         </xsl:choose>
  1228.     </xsl:variable>
  1229.  
  1230.     <xsl:variable name="KeyValueSelect">
  1231.         <xsl:choose>
  1232.             <!-- if there is a field with a KeyXPath -->
  1233.             <xsl:when test="count($View/Fields/Field[string-length(@KeyXPath) != 0]) > 0">
  1234.                 <xsl:value-of select="$View/Fields/Field[string-length(@KeyXPath) != 0]/@KeyXPath"/>
  1235.             </xsl:when>
  1236.             <xsl:otherwise>''</xsl:otherwise>
  1237.         </xsl:choose>
  1238.     </xsl:variable>
  1239.  
  1240.     <!-- put the values needed to make the automode template call in attributes of a span tag -->
  1241.     <span ddwrt:amkeyfield="{$KeyFieldSelect}" ddwrt:amkeyvalue="{$KeyValueSelect}" ddwrt:ammode="{@mode}"></span>
  1242. <!--
  1243.     <out:call-template name="{$basename}.automode">
  1244.         <out:with-param name="KeyField">
  1245.             <xsl:value-of select="$KeyFieldSelect"/>
  1246.         </out:with-param>
  1247.         <out:with-param name="KeyValue">
  1248.             <xsl:attribute name="select">
  1249.                 <xsl:value-of select="$KeyValueSelect"/>
  1250.             </xsl:attribute>
  1251.         </out:with-param>
  1252.         <out:with-param name="Mode">
  1253.             <xsl:value-of select="@mode"/>
  1254.         </out:with-param>
  1255.     </out:call-template>
  1256. -->
  1257. </xsl:template>
  1258.  
  1259. <xsl:template match="dvt_Footer">
  1260.     <xsl:if test="$ShowFooter = '1'" ddwrt:cf_ignore="1">
  1261.         <out:call-template name="{$basename}.footer">
  1262.             <out:with-param name="Rows" select="$Rows"/>
  1263.         </out:call-template>
  1264.     </xsl:if>
  1265. </xsl:template>
  1266.  
  1267. <xsl:template match="dvt_FormActions">
  1268.     <out:call-template name="{$basename}.formactions"/>
  1269. </xsl:template>
  1270.  
  1271. <!-- designed to be called from within the commandfooter template -->
  1272. <xsl:template match="dvt_Navigation">
  1273.     <out:if>
  1274.         <xsl:attribute name="test">
  1275.             <xsl:choose>
  1276.                 <xsl:when test="$DoXSLPaging = '1'">$FirstRow > 1 or $LastRow < $dvt_RowCount</xsl:when>
  1277.                 <xsl:otherwise>$FirstRow > 1 or $dvt_nextpagedata</xsl:otherwise>
  1278.             </xsl:choose>
  1279.         </xsl:attribute>
  1280.         
  1281.         <out:call-template name="{$basename}.navigation">
  1282.             <out:with-param name="FirstRow" select="$FirstRow"/>
  1283.             <out:with-param name="LastRow" select="$LastRow"/>
  1284.             <out:with-param name="RowLimit" select="$RowLimit"/>
  1285.             <out:with-param name="dvt_RowCount" select="$dvt_RowCount"/>
  1286.             <out:with-param name="RealLastRow" select="$RealLastRow"/>
  1287.         </out:call-template>
  1288.     </out:if>
  1289. </xsl:template>
  1290.  
  1291. <xsl:template name="GenFieldView">
  1292.   <xsl:param name="ThisField"/>
  1293.  
  1294.   <xsl:call-template name="gen-field-view">
  1295.     <xsl:with-param name="xpath" select="$ThisField/@Value"/>
  1296.     <xsl:with-param name="title" select="$ThisField/@Title"/>
  1297.     <xsl:with-param name="type" select="$ThisField/@Type"/>
  1298.     <xsl:with-param name="rich" select="$ThisField/@Rich"/>
  1299.   </xsl:call-template>
  1300. </xsl:template>
  1301.  
  1302. <xsl:template name="GenFieldForm">
  1303.   <xsl:param name="ThisField"/>
  1304.   <xsl:param name="IsInsertField"/>
  1305.  
  1306.   <xsl:call-template name="gen-field-form">
  1307.     <xsl:with-param name="xpath" select="$ThisField/@Value"/>
  1308.     <xsl:with-param name="xpathraw" select="$ThisField/@ValueRaw"/>
  1309.     <xsl:with-param name="title" select="$ThisField/@Title"/>
  1310.     <xsl:with-param name="type" select="$ThisField/@Type"/>
  1311.     <xsl:with-param name="keyname" select="$ThisField/@KeyName"/>
  1312.     <xsl:with-param name="keyxpath" select="$ThisField/@KeyXPath"/>
  1313.     <xsl:with-param name="formfieldprefix" select="$ThisField/@FormFieldPrefix"/>
  1314.     <xsl:with-param name="choices" select="$ThisField/Choices"/>
  1315.     <xsl:with-param name="outputformat" select="$ThisField/@OutputFormat" />
  1316.     <xsl:with-param name="IsInsertField" select="$IsInsertField"/>
  1317.   </xsl:call-template>
  1318. </xsl:template>
  1319.  
  1320. <xsl:template match="dvt_FieldView">
  1321.   <xsl:param name="ThisField"/>
  1322.  
  1323.   <xsl:call-template name="GenFieldView">
  1324.     <xsl:with-param name="ThisField" select="$ThisField"/>
  1325.   </xsl:call-template>
  1326. </xsl:template>
  1327.  
  1328. <xsl:template match="dvt_FieldView[@Name]">
  1329.   <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/>
  1330.  
  1331.   <xsl:call-template name="GenFieldView">
  1332.     <xsl:with-param name="ThisField" select="$ThisField"/>
  1333.   </xsl:call-template>
  1334. </xsl:template>
  1335.  
  1336. <xsl:template match="dvt_FieldEdit">
  1337.   <xsl:param name="ThisField"/>
  1338.  
  1339.   <xsl:choose>
  1340.     <xsl:when test="$ThisField/@ReadOnly = '0'">
  1341.       <xsl:call-template name="GenFieldForm">
  1342.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1343.       </xsl:call-template>
  1344.     </xsl:when>
  1345.     <xsl:otherwise>
  1346.       <xsl:call-template name="GenFieldView">
  1347.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1348.       </xsl:call-template>
  1349.     </xsl:otherwise>
  1350.   </xsl:choose>
  1351. </xsl:template>
  1352.  
  1353. <xsl:template match="dvt_FieldEdit[@Name]">
  1354.   <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/>
  1355.  
  1356.   <xsl:choose>
  1357.     <xsl:when test="$ThisField/@ReadOnly = '0'">
  1358.       <xsl:call-template name="GenFieldForm">
  1359.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1360.       </xsl:call-template>
  1361.     </xsl:when>
  1362.     <xsl:otherwise>
  1363.       <xsl:call-template name="GenFieldView">
  1364.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1365.       </xsl:call-template>
  1366.     </xsl:otherwise>
  1367.   </xsl:choose>
  1368. </xsl:template>
  1369.  
  1370. <xsl:template match="dvt_FieldInsert">
  1371.   <xsl:param name="ThisField"/>
  1372.  
  1373.   <xsl:choose>
  1374.     <xsl:when test="$ThisField/@ReadOnly = '0'">
  1375.       <xsl:call-template name="GenFieldForm">
  1376.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1377.         <xsl:with-param name="IsInsertField" select="'1'"/>
  1378.       </xsl:call-template>
  1379.     </xsl:when>
  1380.     <xsl:otherwise>
  1381.       <xsl:call-template name="GenFieldView">
  1382.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1383.       </xsl:call-template>
  1384.     </xsl:otherwise>
  1385.   </xsl:choose>
  1386. </xsl:template>
  1387.  
  1388. <xsl:template match="dvt_FieldInsert[@Name]">
  1389.   <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/>
  1390.  
  1391.   <xsl:choose>
  1392.     <xsl:when test="$ThisField/@ReadOnly = '0'">
  1393.       <xsl:call-template name="GenFieldForm">
  1394.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1395.         <xsl:with-param name="IsInsertField" select="'1'"/>
  1396.       </xsl:call-template>
  1397.     </xsl:when>
  1398.     <xsl:otherwise>
  1399.       <xsl:call-template name="GenFieldView">
  1400.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1401.       </xsl:call-template>
  1402.     </xsl:otherwise>
  1403.   </xsl:choose>
  1404. </xsl:template>
  1405.  
  1406. <xsl:template match="dvt_FieldTitle[@Name]">
  1407.     <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/>
  1408.     <xsl:value-of select="$ThisField/@Title" />
  1409.     <xsl:if test="$ThisField/@Required = '1' and $FormControlMode and $GenerateForm = '1'">
  1410.         <span class="ms-formvalidation"> *</span>
  1411.     </xsl:if>        
  1412. </xsl:template>
  1413.  
  1414. <xsl:template match="dvt_FieldTitle">
  1415.     <xsl:param name="ThisField"/>
  1416.     <xsl:value-of select="$ThisField/@Title" />
  1417.     <xsl:if test="$ThisField/@Required = '1' and $FormControlMode and $GenerateForm = '1'">
  1418.         <span class="ms-formvalidation"> *</span>
  1419.     </xsl:if>        
  1420. </xsl:template>
  1421.  
  1422. <xsl:template match="dvt_FieldHeader[@Name]">
  1423.     <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/>
  1424.     <out:variable name="{$ThisField/@FName}">
  1425.         <out:call-template name="dvt.headerfield">
  1426.             <out:with-param name="fieldname">
  1427.                 <xsl:value-of select="$ThisField/@Value"/>
  1428.             </out:with-param>
  1429.             <out:with-param name="fieldtitle">
  1430.                 <xsl:value-of select="$ThisField/@Title"/>
  1431.             </out:with-param>
  1432.             <out:with-param name="displayname">
  1433.                 <xsl:value-of select="$ThisField/@Title"/>
  1434.             </out:with-param>            
  1435.         </out:call-template>
  1436.     </out:variable>
  1437.     <out:copy-of select="${$ThisField/@FName}" />
  1438. </xsl:template>
  1439.  
  1440. <xsl:template match="dvt_FieldHeader">
  1441.     <xsl:param name="ThisField"/>
  1442.     <out:variable name="{$ThisField/@FName}">
  1443.         <out:call-template name="dvt.headerfield">
  1444.             <out:with-param name="fieldname">
  1445.                 <xsl:value-of select="$ThisField/@Value"/>
  1446.             </out:with-param>
  1447.             <out:with-param name="fieldtitle">
  1448.                 <xsl:value-of select="$ThisField/@Title"/>
  1449.             </out:with-param>
  1450.             <out:with-param name="displayname">
  1451.                 <xsl:value-of select="$ThisField/@Title"/>
  1452.             </out:with-param>            
  1453.         </out:call-template>
  1454.     </out:variable>
  1455.     <out:copy-of select="${$ThisField/@FName}" />
  1456. </xsl:template>
  1457.  
  1458. <xsl:template match="dvt_FieldFilter">
  1459.     <xsl:param name="ThisField"/>
  1460.  
  1461.         <out:call-template name="dvt.filterfield">
  1462.             <out:with-param name="fieldname">
  1463.                 <!-- Remove synthetized ddw prefixes used for default namespaces when calling into the dvt.filterfield template. -->
  1464.                 <xsl:choose>
  1465.                     <xsl:when test="contains($ThisField/@Value, ':') and starts-with($ThisField/@Value, 'ddw')">
  1466.                         <xsl:value-of select="substring-after($ThisField/@Value, ':')"/>
  1467.                     </xsl:when>
  1468.                     <xsl:otherwise>
  1469.                         <xsl:value-of select="$ThisField/@Value"/>
  1470.                     </xsl:otherwise>
  1471.                 </xsl:choose>
  1472.             </out:with-param>
  1473.             <out:with-param name="fieldtitle">
  1474.                 <!-- Remove synthetized ddw prefixes used for default namespaces when calling into the dvt.filterfield template. -->
  1475.                 <xsl:choose>
  1476.                     <xsl:when test="contains($ThisField/@Title, ':') and starts-with($ThisField/@Title, 'ddw')">
  1477.                         <xsl:value-of select="substring-after($ThisField/@Title, ':')"/>
  1478.                     </xsl:when>
  1479.                     <xsl:otherwise>
  1480.                         <xsl:value-of select="$ThisField/@Title"/>
  1481.                     </xsl:otherwise>
  1482.                 </xsl:choose>
  1483.             </out:with-param>
  1484.             <out:with-param name="Rows" select="$Rows"/>
  1485.             <out:with-param name="fieldtype">
  1486.                 <xsl:value-of select="$ThisField/@Type"/>
  1487.             </out:with-param>
  1488.         </out:call-template>
  1489.  
  1490. </xsl:template>
  1491.  
  1492. <xsl:template match="dvt_FieldFilter[@Name]">
  1493.     <xsl:variable name="ThisField" select="$View/Fields/Field[@FName=current()/@Name]"/>
  1494.  
  1495.         <out:call-template name="dvt.filterfield">
  1496.             <out:with-param name="fieldname">
  1497.                 <xsl:value-of select="$ThisField/@Value"/>
  1498.             </out:with-param>
  1499.             <out:with-param name="fieldtitle">
  1500.                 <xsl:value-of select="$ThisField/@Title"/>
  1501.             </out:with-param>
  1502.             <out:with-param name="Rows" select="$Rows"/>
  1503.             <out:with-param name="fieldtype">
  1504.                 <xsl:value-of select="$ThisField/@Type"/>
  1505.             </out:with-param>
  1506.         </out:call-template>
  1507.  
  1508. </xsl:template>
  1509.  
  1510. <xsl:template match="dvt_ForEachField">
  1511.   <xsl:if test="$TopLevel = '1' or not(@TopLevel)">
  1512.     <xsl:variable name="CurNode" select="."/>
  1513.     <xsl:variable name="ReqFields">
  1514.       <xsl:if test="@ExcludeRequired">
  1515.         <xsl:for-each select="$Style/RequiredFields/Field">
  1516.           <xsl:text> </xsl:text>
  1517.           <xsl:value-of select="@Name"/>
  1518.           <xsl:text> </xsl:text>
  1519.         </xsl:for-each>
  1520.       </xsl:if>
  1521.     </xsl:variable>
  1522.     <xsl:for-each select="$View/Fields/Field[not(@Hidden) and not(contains($ReqFields,concat(' ',@FName,' ')))]">
  1523.       <xsl:variable name="ThisField" select="."/>
  1524.       <xsl:variable name="FieldNum" select="position()"/>
  1525.       <xsl:apply-templates select="$CurNode/node()">
  1526.         <xsl:with-param name="ThisField" select="$ThisField"/>
  1527.         <xsl:with-param name="FieldNum" select="$FieldNum"/>
  1528.       </xsl:apply-templates>
  1529.     </xsl:for-each>
  1530.   </xsl:if>
  1531. </xsl:template>
  1532.   
  1533.   <xsl:template match="dvt_ForEachRow">
  1534.     <out:for-each select="{$View/RowPath}">
  1535.         <xsl:apply-templates select="node()"/>
  1536.     </out:for-each>
  1537. </xsl:template>
  1538.  
  1539. <xsl:template match="dvt_IfNotEmpty">
  1540.     <out:if test="count({$View/RowPath})!=0">
  1541.         <xsl:apply-templates/>
  1542.     </out:if>
  1543. </xsl:template>
  1544.  
  1545. <xsl:template match="dvt_IfTitleEmpty">
  1546.     <out:if test="$fieldtitle">
  1547.         <xsl:apply-templates/>
  1548.     </out:if>
  1549. </xsl:template>
  1550.  
  1551. <xsl:template match="dvt_IfEmpty">
  1552.     <out:if test="count({$View/RowPath})=0">
  1553.         <xsl:apply-templates/>
  1554.     </out:if>
  1555. </xsl:template>
  1556.  
  1557. <xsl:template match="dvt_IfNewGroup">
  1558.     <xsl:if test="$View/Sorting[@Grouping='TRUE']">
  1559.         <out:if test="$NewGroup = 'TRUE'" ddwrt:cf_ignore="1">
  1560.             <xsl:apply-templates>
  1561.                 <xsl:with-param name="ThisField" select="$View/Fields/Field[@FName=$View/Sorting/SortBy[1]/@Field]"/>
  1562.             </xsl:apply-templates>
  1563.         </out:if>
  1564.     </xsl:if>
  1565. </xsl:template>
  1566.  
  1567. <xsl:template match="dvt_IfEvenRow">
  1568.     <out:if test="position() mod 2 = 0" ddwrt:cf_ignore="1">
  1569.         <xsl:apply-templates/>
  1570.     </out:if>
  1571. </xsl:template>
  1572.  
  1573. <xsl:template match="dvt_IfOddRow">
  1574.     <out:if test="position() mod 2 != 0" ddwrt:cf_ignore="1">
  1575.         <xsl:apply-templates/>
  1576.     </out:if>
  1577. </xsl:template>
  1578.  
  1579. <xsl:template match="dvt_IfFirstRow">
  1580.     <out:if test="position() = 1" ddwrt:cf_ignore="1">
  1581.         <xsl:apply-templates/>
  1582.     </out:if>
  1583. </xsl:template>
  1584.  
  1585. <xsl:template match="dvt_IfLastRow">
  1586.     <out:if test="position() = last()" ddwrt:cf_ignore="1">
  1587.         <xsl:apply-templates/>
  1588.     </out:if>
  1589. </xsl:template>
  1590.  
  1591. <xsl:template match="dvt_IfNotFirstRow">
  1592.     <out:if test="position() != 1" ddwrt:cf_ignore="1">
  1593.         <xsl:apply-templates/>
  1594.     </out:if>
  1595. </xsl:template>
  1596.  
  1597. <xsl:template match="dvt_IfNotLastRow">
  1598.     <out:if test="position() != last()" ddwrt:cf_ignore="1">
  1599.         <xsl:apply-templates/>
  1600.     </out:if>
  1601. </xsl:template>
  1602.  
  1603. <xsl:template match="dvt_AlternateRow">
  1604.     <out:if test="position() mod 2 = 1">
  1605.         <out:attribute name="class">ms-alternating</out:attribute>
  1606.     </out:if>
  1607. </xsl:template>
  1608.  
  1609. <xsl:template match="dvt_IfAutoMode">
  1610.     <out:if test="${$basename}_automode = '1'" ddwrt:cf_ignore="1">
  1611.         <xsl:apply-templates/>
  1612.     </out:if>
  1613. </xsl:template>
  1614.  
  1615. <xsl:template match="dvt_IfFirstField">
  1616.     <xsl:param name="FieldNum"/>
  1617.     <xsl:if test="$FieldNum = 1">
  1618.         <xsl:apply-templates/>
  1619.     </xsl:if>
  1620. </xsl:template>
  1621.  
  1622. <xsl:template match="dvt_IfNotFirstField">
  1623.     <xsl:param name="FieldNum"/>
  1624.     <xsl:if test="$FieldNum != 1">
  1625.         <xsl:apply-templates/>
  1626.     </xsl:if>
  1627. </xsl:template>
  1628.  
  1629. <xsl:template match="dvt_IfVarEq">
  1630.     <out:if test="${@name} = '{@value}'" ddwrt:cf_ignore="1">
  1631.         <xsl:apply-templates/>
  1632.     </out:if>
  1633. </xsl:template>
  1634.  
  1635. <xsl:template match="dvt_IfGenerateForm">
  1636.     <xsl:if test="$GenerateForm = '1'">
  1637.         <xsl:apply-templates/>
  1638.     </xsl:if>
  1639. </xsl:template>
  1640.  
  1641. <xsl:template match="dvt_WhenInsertMode">
  1642.     <out:when test="$IsInsertMode = '1'">
  1643.         <xsl:apply-templates/>
  1644.     </out:when>
  1645. </xsl:template>
  1646.  
  1647. <xsl:template match="dvt_WhenAutoModeEdit">
  1648.     <out:when test="$Mode = 'edit'">
  1649.         <xsl:apply-templates/>
  1650.     </out:when>
  1651. </xsl:template>
  1652.  
  1653. <xsl:template match="dvt_WhenAutoModeInsert">
  1654.     <out:when test="$Mode = 'insert'">
  1655.         <xsl:apply-templates/>
  1656.     </out:when>
  1657. </xsl:template>
  1658.  
  1659. <xsl:template match="dvt_HTML"><out:text disable-output-escaping="yes"><xsl:apply-templates/></out:text></xsl:template>
  1660.  
  1661. <xsl:template match="dvt_NBSP"><out:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&nbsp;</out:text></xsl:template>
  1662.  
  1663. <xsl:template match="dvt_Comment"><out:comment><xsl:apply-templates/></out:comment></xsl:template>
  1664.  
  1665. <xsl:template match="dvt_GetVar">
  1666.     <out:value-of select="${@Name}"/>
  1667. </xsl:template>
  1668.  
  1669. <xsl:template match="dvt_ShowVar">
  1670.     <out:value-of select="{@Name}"/>
  1671. </xsl:template>
  1672.  
  1673. <xsl:template match="dvt_DisplayVar">
  1674.     <out:value-of select="${@Name}" disable-output-escaping="yes"/>
  1675. </xsl:template>
  1676.  
  1677. <xsl:template match="dvt_ChooseText">
  1678.     <xsl:value-of select="$ChooseText"/>
  1679. </xsl:template>
  1680.  
  1681. <xsl:template match="dvt_PageItemText">
  1682.     <xsl:value-of select="$PageItemText" disable-output-escaping="yes"/>
  1683. </xsl:template>
  1684.  
  1685. <xsl:template match="dvt_PageItemsText">
  1686.     <out:value-of select="$FirstRow"/> - <out:value-of select="$LastRowValue"/>
  1687. </xsl:template>
  1688.  
  1689. <xsl:template match="dvt_ViewText">
  1690.     <xsl:value-of select="$ViewText"/>
  1691. </xsl:template>
  1692.  
  1693. <xsl:template match="dvt_CountText">
  1694.     <xsl:value-of select="$CountText" disable-output-escaping="yes"/>
  1695. </xsl:template>
  1696.  
  1697. <xsl:template match="*">
  1698.     <xsl:param name="ThisField"/>
  1699.     <xsl:copy>
  1700.         <xsl:copy-of select="@*"/>
  1701.         <xsl:apply-templates>
  1702.             <xsl:with-param name="ThisField" select="$ThisField"/>
  1703.         </xsl:apply-templates>
  1704.     </xsl:copy>
  1705. </xsl:template>
  1706.  
  1707. </xsl:stylesheet>